package pl.vanta.utils.gui.tables;

import javax.swing.ListSelectionModel;

public enum VTableSelectionMode
{
	SINGLE(ListSelectionModel.SINGLE_SELECTION), MULTI(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION), INTERVAL(
			ListSelectionModel.SINGLE_INTERVAL_SELECTION);

	private int	value;

	VTableSelectionMode(int value)
	{
		this.value = value;
	}

	public int getValue()
	{
		return this.value;
	}

	public static VTableSelectionMode create(int value)
	{
		switch (value)
		{
			case ListSelectionModel.SINGLE_SELECTION:
				return SINGLE;
			case ListSelectionModel.MULTIPLE_INTERVAL_SELECTION:
				return MULTI;
			case ListSelectionModel.SINGLE_INTERVAL_SELECTION:
				return INTERVAL;
			default:
				return null;
		}
	}
}